import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [

  {
    title: '金额',
    align: "center",
    dataIndex: 'balance'
  },
  {
    title: '收支类型',
    align: "center",
    dataIndex: 'ieType_dictText'
  },
  {
    title: '收支业务类型',
    align: "center",
    dataIndex: 'ieBizType_dictText'
  },
  {
    title: '标题',
    align: "center",
    dataIndex: 'subject'
  },
  {
    title: '描述',
    align: "center",
    dataIndex: 'body'
  },

];

//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: "收支类型",
    field: 'ieType',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: "ie_type"
    },
    //colProps: {span: 6},
  },
  {
    label: "收支业务类型",
    field: 'ieBizType',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: "ie_biz_type"
    },
    //colProps: {span: 6},
  },
];

//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '用户',
    field: 'userId',
    component: 'Input',
  },
  {
    label: '用户手机号',
    field: 'userPhone',
    component: 'Input',
  },
  {
    label: '金额',
    field: 'balance',
    component: 'InputNumber',
  },
  {
    label: '收支类型',
    field: 'ieType',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: "ie_type"
    },
  },
  {
    label: '收支业务类型',
    field: 'ieBizType',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: "ie_biz_type"
    },
  },
  {
    label: '标题',
    field: 'subject',
    component: 'Input',
  },
  {
    label: '描述',
    field: 'body',
    component: 'Input',
  },
  {
    label: '扩展参数',
    field: 'extParam',
    component: 'Input',
  },
	// TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];

// 高级查询数据
export const superQuerySchema = {
  userId: {title: '用户',order: 0,view: 'text', type: 'string',},
  userPhone: {title: '用户手机号',order: 1,view: 'text', type: 'string',},
  balance: {title: '金额',order: 2,view: 'number', type: 'number',},
  ieType: {title: '收支类型',order: 3,view: 'list', type: 'string',dictCode: 'ie_type',},
  ieBizType: {title: '收支业务类型',order: 4,view: 'list', type: 'string',dictCode: 'ie_biz_type',},
  subject: {title: '标题',order: 5,view: 'text', type: 'string',},
  body: {title: '描述',order: 6,view: 'text', type: 'string',},
  extParam: {title: '扩展参数',order: 7,view: 'text', type: 'string',},
};
